li      r2, 10
li      r3, 30
li      r4, 70
li      r5, 100
li      r6, 130
li      r7, 160
addi    r8, r0, 0


init: 
 
sub     r10, r2 ,r8
blz     r10, endinit
bez     r10, endinit

add	r9, r3, r8		// memlocation = base address + offset into A
store	r8, 0(r9)		// A[i] = i

add	r9, r4, r8		// memlocation = base address + offset into B
store	r8, 0(r9)		// B[i] = i

add	r9, r5, r8		// memlocation = base address + offset into C
store	r8, 0(r9)		// C[i] = i

add	r9, r6, r8		// memlocation = base address + offset into D
store	r8, 0(r9)		// D[i] = i

add	r9, r7, r8		// memlocation = base address + offset into E
store	r8, 0(r9)		// E[i] = i

addi	r8, r8, 1		// i++

bez     r0,init

endinit:

addi	r8, r0, 0		// i=0

loop:

sub     r9, r2 ,r8
blz     r9, endloop
bez     r9, endloop
	
add	r10, r5, r8		// memlocation C[i] = base addr of C + offset

add	r11, r3, r8		// memlocation A[i] = base addr of A + offset
load	r14, 0(r11)		// r14 = A[i]

add	r12, r4, r8		// memlocation B[i] = base addr of B + offset
load	r15, 0(r12)		// r15 = B[i]

add	r13, r14, r15		// r13 = A[] + B[]
store	r13, 0(r10)		// C[i] = r13

addi	r8, r8, 1		// i++

bez     r0,loop
	
endloop:

addi	r8, r0, 0		// i=0



loop2:

sub     r9, r2 ,r8
blz     r9, endloop2
bez     r9, endloop2

add	r10, r6, r8		// memlocation D[i] = base addr of D + offset

add	r11, r5, r8		// memlocation C[i] = base addr of C + offset
load	r14, 0(r11)		// r14 = C[i]

add	r12, r7, r8		// memlocation E[i] = base addr of E + offset
load	r15, 0(r12)		// r15 = E[i]

add	r13, r14, r15		// r13 = C[] + E[]
store	r13,  0(r10)		// D[i] = r13

addi	r8, r8, 1		// i++

bez     r0,loop2
	
endloop2:




addi	r8, r0, 0		// i=0
loop1:

sub     r9, r2 ,r8
blz     r9, endloop1
bez     r9, endloop1
	
add	r11, r3, r8		// memlocation A[i] = base addr of A + offset
load	r14, 0(r11)		// r14 = A[i]

add	r12, r4, r8		// memlocation B[i] = base addr of B + offset
load	r15, 0(r12)		// r14 = B[i]

add	r13, r14, r15		// r13 = A[] + B[]
store	r13, 0(r11)		// A[i] = r13

addi	r8, r8, 1		// i++
bez     r0,loop1

endloop1:
